<?php

class BlogModel extends Model
{
    //定义表名
    public $table = 'blog';

    //构造函数
    public function __init($param)
    {
        $this->table = $param['table'];
    }

    //读取一条记录
    public function getOne($id)
    {
        return $this->find($id);
    }

    //获得博客标题
    public function getTitle($id)
    {
        $data = $this->find($id);
        return $data['title'];
    }
}